package com.android.wellcherish.workclock.view;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.wellcherish.workclock.R;
import com.android.wellcherish.workclock.bean.data.IBaseBean;
import com.android.wellcherish.workclock.bean.data.ModeRecord;
import com.android.wellcherish.workclock.bean.data.RecordAdapterHeadBean;
import com.android.wellcherish.workclock.util.ModeUtil;
import com.android.wellcherish.workclock.util.TimeUtil;

/**
 * @author 张文琛
 * @date 2020/3/15 16:56
 */
public class RecordHeadViewHolder extends RecordBaseViewHolder {
    public ImageView ivMode;
    public TextView tvDate;

    public RecordHeadViewHolder(@NonNull Context context, @NonNull View itemView) {
        super(context, itemView);
        ivMode = itemView.findViewById(R.id.iv_mode);
        tvDate = itemView.findViewById(R.id.tv_date);
    }

    @Override
    public void onBindViewHolder(@NonNull IBaseBean baseBean, int position) {
        if(!(baseBean instanceof RecordAdapterHeadBean)) {
            return;
        }
        RecordAdapterHeadBean bean = (RecordAdapterHeadBean) baseBean;
        ivMode.setImageDrawable(context.getDrawable(bean.getIconRes()));
        tvDate.setText(bean.getDate());
    }
}
